import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter);

//使用赖加载
const Home = () => import('../components/home.vue')
const Tab = () => import('../components/tab.vue')
const My = () => import('../components/my.vue')
const Car = () => import('../components/car.vue')

const routes = [
    {
        path:'/',
        redirect: '/home'
    },
    {
        path:'/home',
        component: Home
    },
    {
        path:'/my',
        component: My
    },
    {
        path:'/tab',
        component: Tab
    },
    {
        path:'/car',
        component: Car
    },
]
const router = new VueRouter({
    mode:'history',
    routes
})

export default router;
